fix: Add SRPoint and SRRectangleROI sub-types#112
Merged
igoroctaviano merged 6 commits intomasterfrom Apr 1, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original Upstream PR: OHIF#5858
New point tool for scoord3d points:
Context
Fixes #107
Improves DICOM SR annotation visualization. Per maintainer feedback: create sub-types of Probe and RectangleROI with custom configuration rather than modifying base tools. SRPoint and SRRectangleROI show the semantic label (e.g. "Lesion" from Finding concept) instead of intensity/coordinates or area/stats, and are used only for SR hydration—they do not replace Probe/RectangleROI in the toolbar.
Client feedback addressed:
Changes & Results
New SR subtypes
SRPoint– sub-type of Probe; customSRPointToolrenders a compact cross marker;getSRPointTextLinesreturns only the label.SRRectangleROI– sub-type of RectangleROI;getSRRectangleROITextLinesreturns only the label.Files added
extensions/cornerstone-dicom-sr/src/tools/SRPointTool.ts– extends ProbeTool with customrenderAnnotationthat draws a cross (plus) viadrawPath; compact size (6px), reduced text padding.extensions/cornerstone-dicom-sr/src/utils/srToolGetTextLines.ts– getTextLines implementations for SR subtypes.Files modified
extensions/cornerstone-dicom-sr/src/tools/toolNames.ts– addedSRPoint,SRRectangleROI.extensions/cornerstone-dicom-sr/src/init.ts– register SRPointTool and SRRectangleROI tool instances with getTextLines; dashed line styles.extensions/cornerstone-dicom-sr/src/utils/hydrateStructuredReport.ts– useSRPoint/SRRectangleROIastoolNameForRenderingwhen hydrating Probe/RectangleROI; always lock hydrated annotations.extensions/cornerstone-dicom-sr/src/tools/DICOMSRDisplayTool.ts–renderPointdraws cross viadrawPath; reduced text box padding (6px).extensions/cornerstone-dicom-sr/src/utils/addSRAnnotation.ts– setisLocked: trueand calllocking.setAnnotationLocked()for preview annotations.extensions/cornerstone-dicom-sr/src/utils/getLabelFromDCMJSImportedToolData.js– fallback tofinding.CodeMeaningfor standard DICOM codes (e.g. "Lesion").modes/basic/src/initToolGroups.ts– add SRPoint, SRRectangleROI as passive tools (default, MPR, SRToolGroup).modes/basic-test-mode/src/initToolGroups.ts– same.modes/usAnnotation/src/initToolGroups.js– same.extensions/cornerstone/src/utils/measurementServiceMappings/measurementServiceMappingsFactory.ts– SRPoint → POINT, SRRectangleROI → RECTANGLE.extensions/cornerstone/src/initMeasurementService.ts– add SRPoint, SRRectangleROI to supported tools.extensions/cornerstone/src/utils/measurementServiceMappings/constants/supportedTools.js– add SRPoint, SRRectangleROI.Design decisions
Testing
E2E snapshots may need regeneration for Scoord3dProbe, ScoordRectangle:
Before: Point annotations showed intensity/coordinates; rectangle showed area/stats.
After: Point annotations show label + compact cross marker; rectangle shows label only; all SR annotations locked.
Checklist
PR
semantic-release format and guidelines.
Suggested PR title:
feat(cornerstone-dicom-sr): add SRPoint and SRRectangleROI subtypes for label-only SR hydration with cross markersCode
etc.)
Public Documentation Updates
additions or removals. (N/A – internal extension tools only)
Tested Environment